<include file="Common/index_header-new" />
<link rel="stylesheet" href="__PUBLIC__/home/v2/css/detail.css?v=20161028">
<!-- 详情页样式 -->
<link rel="stylesheet" href="__PUBLIC__/home/v2/css/default.min.css?v=20161028">
<!-- 代码框样式 -->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/waitMe.css" />
<!--main-body start-->
<div class="main-body">
	<!--container start-->
	<div class="container">
		<!--面包屑 start-->
		<div class="address-column row">
			<div class="address pull-left">
				<i class="fa fa-map-marker"></i>
				<a href="index.html" title="首页">首页</a>
				<if condition="$data[0]['category_id'] gt 0">
					<a href="/category/index.html?cid={$data[0]['category_id']}" target="_blank">{$data[0].category_name}</a>
				</if>
				<if condition="$data[0]['children_category_id'] gt 0">
					<a href="/category/index.html?cid={$data[0]['category_id']}&tid={$data[0]['children_category_id']}" target="_blank">{$data[0].chile_cate_name}</a>
				</if>
				<a class="active">{$data[0].services_name}</a>
			</div>
		</div>
		<!--面包屑 end-->
		<!--产品部分 start-->
		<div class="row detail">
			<div class="col-xs-12 col-sm-6 col-md-4 detail-img text-center">
				<img src="{$data[0].service_logo}" title="{$data[0].services_name}" />
			</div>
			<div class="col-xs-12 col-sm-6 col-md-8 detail-text">
				<h2 class="_service_id" data-serviceid="{$data[0]['service_id']}">{$data[0].services_name}</h2>
				<p class="describe margin-0">{$data[0].service_introduction}</p>
				<if condition="$data[0]['tag_string'] neq ''">
					<?php $tag_list_recommend = explode(',',$data[0]['tag_string']); ?>
					<ul class="list-unstyled">
						<foreach name="tag_list_recommend" item="tag_rec" key="tag_rec_key">
							<if condition="$tag_rec_key lt 3">
								<li>{$tag_rec}</li>
							</if>
						</foreach>
					</ul>
				</if>
				<!--TODO 调用人数-->
				<p>服务商：{$data[0].service_publisher}</p>
				<p>调用人数：{$data[0].call_num}</p>
				<p>更新时间：{$greatest_update_time}</p>
				<div class="api">
					<foreach name="data" item="value" key="k">
						<a class="btn btn-white _api_name <if condition=" $k eq 0 ">active</if> " data-id="{$value.api_id}" data-auth="{$value.auth}" data-sid="{$value.service_id}" data-name="{$value.api_name}" data-ename="{$value.api_name_en}" data-ser-ename="{$value.services_name_en}">{$value.api_name}</a>
					</foreach>
				</div>
				<div class="detail-bottom pull-left">
					<if condition="$data[0]['price'] gt 0">
						<span class="_unitPrice"><i class="fa fa-yen"></i>{$data[0].price}</span>起
						<else />
						<span class='_unitPrice'>免费</span>
					</if>
				</div>
				<a href="javascript:void(0);" class="btn btn-primary btn-routine detail-bottom pull-left _buyBtn" title="购买" id="price">购买</a>
			</div>
		</div>
		<!--产品部分 end-->

		<!--调试部分 start-->
		<div class="detail-body">
			<input type="hidden" value='{$data[0].service_request_heads}' id="req_head" />
			<input type="hidden" value='{$data[0].service_response_heads}' id="resp_head" />
			<input type="hidden" value='{$data[0].services_name}' id="service_name_cn" />
			<input type="hidden" value='{$data[0].service_publisher}' id="service_publisher" />
			<!--选项卡头部 start-->
			<ul class="nav nav-tabs _navTab">
				<li class="active">
					<a href="#home" data-toggle="tab" aria-expanded="false">API</a>
				</li>
				<li class="">
					<a href="#profile" data-toggle="tab" aria-expanded="true">错误代码参考</a>
				</li>
			</ul>
			<!--选项卡头部 end-->
			<div id="service_api_content"></div>
			<script id="service_api_id" type="text/html">
				<!--选项卡内容 start-->
				<div class="tab-content">
					<input type="hidden" id="api_is_charge" value="{{list.api_is_charge}}" />
					<input type="hidden" id="api_name_cn" value="{{list.api_name}}" />
					<!--api start-->
					<div class="tab-pane fade in active" id="home">
						<div class="form-group">
							<label class="col-xs-12 col-md-1">API名称:</label>
							<div class="col-xs-12 col-md-10">
								{{list.api_name}}
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-md-1">API介绍：</label>
							<div class="col-xs-12 col-md-10">
								{{list.api_introduction}}
							</div>
						</div>
						<div class="form-group update">
							<label class="col-xs-12 col-md-1">数据更新类型:</label>
							<div class="col-xs-12 col-md-10">
								{{if list.api_update_type==1}}
								<span class="left"><i class="fa fa-exchange"></i>实时更新</span> {{else if list.api_update_type==2}}
								<span class="right"><i class="fa fa-long-arrow-right"></i>静态数据</span> {{/if}}
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-md-1">测试工具:</label>
							<div class="col-xs-12 col-md-10">
								<a href="/Index/toolshttpproxy.html?api_id={{list.api_id}}" target="_blank" title="API调试工具" class="_debugTool"><i class="fa fa-link"></i>API调试工具</a>
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-md-1">接口地址:</label>
							<div class="col-xs-12 col-md-10">
								{{list.url_priex}}/open/{{list.s_service_name_en}}/{{list.api_name_en}}
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-md-1">请求示例:</label>
							<div class="col-xs-12 col-md-10">
								curl '{{list.api_sample_url}}' -H 'Authorization:Basic base64_encryption(email:token)'
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-md-1">请求方式:</label>
							<div class="col-xs-12 col-md-10">
								{{if list.api_request_method==0}}GET/POST{{else if list.api_request_method==1}}POST{{else}}GET{{/if}}
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-md-1">返回格式:</label>
							<div class="col-xs-12 col-md-10">
								{{list.api_result_format | toUpperCase }}
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-md-1">授权方式:</label>
							<div class="col-xs-12 col-md-10">
								{{list.api_authorized_type}}
								<p class="p-text">使用 HTTP Basic Authentication 方式做访问授权，需在 HTTP Header 里添加认证信息，Authorization: Basic base64_auth_string，
									</br>其中 base64_auth_string 的生成算法为: base64(user:token)，即用user加上冒号，加上token拼接起来，再做base64转换。
								</p>
							</div>
						</div>
						<!--TODO Http请求头/响应头-->
						{{if list.api_request_param}}
						<div class="form-group">
							<label class="col-xs-12 col-md-1">请求参数:</label>
							<div class="col-xs-12 col-md-10">
								<table class="table table-detail table-striped table-hover">
									<colgroup>
										<col class="col-xs-2">
										<col class="col-xs-2">
										<col class="col-xs-2">
										<col class="col-xs-2">
										<col class="col-xs-4">
									</colgroup>
									<thead>
										<tr>
											<th>参数名</th>
											<th>类型</th>
											<th>是否必填</th>
											<th>示例默认值</th>
											<th>说明</th>
										</tr>
									</thead>
									<tbody>
										{{each list.api_request_param as pvalue pkey}}
										<tr>
											<td>{{pvalue.name}}</td>
											<td>{{pvalue.type}}</td>
											{{if pvalue.mast == 0}}
											<td>否</td>
											{{else}}
											<td>是</td>
											{{/if}}
											<td>{{pvalue.default_value}}</td>
											<td>{{pvalue.desc}}</td>
										</tr>
										{{/each}}
									</tbody>
								</table>
							</div>
						</div>
						{{/if}} {{if list.api_result_field}}
						<div class="form-group">
							<label class="col-xs-12 col-md-1">返回字段:</label>
							<div class="col-xs-12 col-md-10">
								<table class="table table-detail table-striped table-hover">
									<colgroup>
										<col class="col-xs-4">
										<col class="col-xs-4">
										<col class="col-xs-4">
									</colgroup>
									<thead>
										<tr>
											<th>参数名</th>
											<th>类型</th>
											<th>说明</th>
										</tr>
									</thead>
									<tbody>
										{{each list.api_result_field as fvalue fkey}}
										<tr>
											<td>{{fvalue.name}}</td>
											<td>{{fvalue.type}}</td>
											<td>{{fvalue.desc}}</td>
										</tr>
										{{/each}}
									</tbody>
								</table>
							</div>
						</div>
						{{/if}} {{if list.api_result_sample}}
						<input type="hidden" value="{{list.api_result_sample}}" class='_inExamCode' />
						<div class="form-group border-0">
							<label class="col-xs-12 col-md-12">JSON返回示例:</label>
							<div class="col-xs-12 col-md-offset-1 col-md-10 _exampleCode"><pre><code class="JSON">{{list.api_result_sample}}</code></pre></div>
						</div>
						{{/if}}
					</div>
					<!--api end-->

					<!--错误代码参考 start-->
					<div class="tab-pane fade " id="profile">
						{{if list.api_error_codes}}
						<div class="form-group">
							<label class="col-xs-12 col-md-1">错误代码:</label>
							<div class="col-xs-12 col-md-10">
								<table class="table table-detail table-striped table-hover">
									<colgroup>
										<col class="col-xs-4">
										<col class="col-xs-4">
										<col class="col-xs-4">
									</colgroup>
									<thead>
										<tr>
											<th>错误码</th>
											<th>错误码返回</th>
											<th>说明</th>
										</tr>
									</thead>
									<tbody>
										{{each list.api_error_codes as cvalue ckey}}
										<tr>
											<td>{{cvalue.code}}</td>
											<td>{{cvalue.info}}</td>
											<td class="pr">{{cvalue.desc}}</td>
										</tr>
										{{/each}}
									</tbody>
								</table>
							</div>
						</div>
						{{/if}}

						<div class="form-group">
							<label class="col-xs-12 col-md-1">系统异常:</label>
							<div class="col-xs-12 col-md-10">
								<table class="table table-detail table-striped table-hover">
									<colgroup>
										<col class="col-xs-4">
										<col class="col-xs-4">
										<col class="col-xs-4">
									</colgroup>
									<thead>
										<tr>
											<th>错误码</th>
											<th>错误码返回</th>
											<th>说明</th>
										</tr>
									</thead>
									<tbody>
										<include file="Common/public_errorcode" />
									</tbody>
								</table>
							</div>
						</div>

					</div>
					<!--错误代码参考 end-->

				</div>
				<!--选项卡内容 end-->
			</script>
		</div>
		<!--调试部分 end-->
		<!--container end-->
	</div>
	<!--main-body end-->
</div>
<!--引导注册弹窗 start-->
<div class="modal fade modal-login _loginBox" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" class="_closeRegister">&times;</span><span class="sr-only">Close</span></button>
			</div>
			<div class="modal-body">
				<p class='_loginText'>免费注册<br/>免费使用</p>
				<div class="form-group">
					<div class="input-group">
						<div class="input-group-addon"> <i class="fa fa-envelope"></i> </div>
						<input type="text" class="form-control _user_email"  placeholder="请输入您的邮箱" tip="邮箱不能为空" />
					</div>
				</div>
				<div class="form-group">
					<div class="input-group">
						<div class="input-group-addon"> <i class="fa fa-key"></i> </div>
						<input type="password" class="form-control _passwd" placeholder="6-16位字符，区分大小写" tip="密码不能为空" />
					</div>
				</div>
				<div class="form-group">
					<input type="checkbox" checked="checked" class="_checkBox"> 我已阅读并接受
					<a href="/help/user_agreen" target="_blank">《云途数据用户服务协议》</a>
				</div>
				<button type="submit" class="btn btn-primary btn-block btn-login _register">注&nbsp;&nbsp;册</button>
				<div class="modal-login-bottom">已有帐号？去
					<a href="/member/login.html" class='_gotoLogin'>登录</a>。</div>
			</div>
		</div>
	</div>
</div>
<!--引导注册弹窗 end-->

<!-- 套餐弹窗 -->
<div class="modal fade modal-package" id='_mealsTypeDiv' tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				选择您要购买的套餐<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" class="_closeSpan">&times;</span><span class="sr-only">Close</span></button>
			</div>
			<div class="modal-body">
				<ul class="list-unstyled hzcp _mealsType"></ul>
			</div>
			<div class="modal-footer"><button type="submit" class="btn btn-primary _submit">提交</button></div>
		</div>
	</div>
</div>
<!-- 套餐弹窗 end -->

<!--隐藏域内容 start-->
<input type="hidden" value="{$api_id}" class="_selected_api_id" />
<!--隐藏域内容 end-->
<include file="Common/index_footer-new" />
<script type="text/javascript" src="__PUBLIC__/home/js/artTemplate.js"></script>
<script type="text/javascript" src="__PUBLIC__/home/js/detail.js?v=20161108"></script>
<script src='__PUBLIC__/home/js/cookie.js?v=20161028'></script>
<script src="__PUBLIC__/home/js/memberV2.js?v=20161028"></script>
<script src="__PUBLIC__/home/v2/js/highlight.min.js"></script>
<script src="__PUBLIC__/home/js/waitMe.js"></script>
</body>
</html>